package com.sgcc.dlsc.monitorredis.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisClusterConfiguration;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import javax.annotation.Resource;

@Configuration
public class RedisConfig {


    @Resource
    ClusterConfigurationProperties clusterProperties;


    @Bean
    public JedisConnectionFactory connectionFactory() {

        return new JedisConnectionFactory(
                new RedisClusterConfiguration(clusterProperties.getNodes()));
    }



}
